\doxysection{seasky\+\_\+protocol.\+h}
\hypertarget{seasky__protocol_8h_source}{}\label{seasky__protocol_8h_source}\index{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/master\_machine/seasky\_protocol.h@{C:/Users/ASUS/Desktop/dm-\/ctrlH7-\/balance-\/9025test/modules/master\_machine/seasky\_protocol.h}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ \_\_SEASKY\_PROTOCOL\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ \_\_SEASKY\_PROTOCOL\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <stdint.h>}}
\DoxyCodeLine{00006\ }
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#define\ PROTOCOL\_CMD\_ID\ 0XA5}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#define\ OFFSET\_BYTE\ 8\ }\textcolor{comment}{//\ 出数据段外，其他部分所占字节数}}
\DoxyCodeLine{00009\ }
\DoxyCodeLine{00010\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct}}
\DoxyCodeLine{00011\ \{}
\DoxyCodeLine{00012\ \ \ \ \ \textcolor{keyword}{struct}}
\DoxyCodeLine{00013\ \ \ \ \ \{}
\DoxyCodeLine{00014\ \ \ \ \ \ \ \ \ uint8\_t\ sof;}
\DoxyCodeLine{00015\ \ \ \ \ \ \ \ \ uint16\_t\ data\_length;}
\DoxyCodeLine{00016\ \ \ \ \ \ \ \ \ uint8\_t\ crc\_check;\ \textcolor{comment}{//\ 帧头CRC校验}}
\DoxyCodeLine{00017\ \ \ \ \ \}\ header;\ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 数据帧头}}
\DoxyCodeLine{00018\ \ \ \ \ uint16\_t\ cmd\_id;\ \ \ \ \ \ \ \textcolor{comment}{//\ 数据ID}}
\DoxyCodeLine{00019\ \ \ \ \ uint16\_t\ frame\_tail;\ \ \ \textcolor{comment}{//\ 帧尾CRC校验}}
\DoxyCodeLine{00020\ \}\ \mbox{\hyperlink{structprotocol__rm__struct}{protocol\_rm\_struct}};}
\DoxyCodeLine{00021\ }
\DoxyCodeLine{00022\ }
\DoxyCodeLine{00023\ \textcolor{comment}{/*更新发送数据帧，并计算发送数据帧长度*/}}
\DoxyCodeLine{00024\ \textcolor{keywordtype}{void}\ get\_protocol\_send\_data(uint16\_t\ send\_id,\ \ \ \ \ \ \ \ \textcolor{comment}{//\ 信号id}}
\DoxyCodeLine{00025\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint16\_t\ flags\_register,\ \textcolor{comment}{//\ 16位寄存器}}
\DoxyCodeLine{00026\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{float}\ *tx\_data,\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 待发送的float数据}}
\DoxyCodeLine{00027\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint8\_t\ float\_length,\ \ \ \ \textcolor{comment}{//\ float的数据长度}}
\DoxyCodeLine{00028\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint8\_t\ *tx\_buf,\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 待发送的数据帧}}
\DoxyCodeLine{00029\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint16\_t\ *tx\_buf\_len);\ \ \ \textcolor{comment}{//\ 待发送的数据帧长度}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00031\ \textcolor{comment}{/*接收数据处理*/}}
\DoxyCodeLine{00032\ uint16\_t\ get\_protocol\_info(uint8\_t\ *rx\_buf,\ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 接收到的原始数据}}
\DoxyCodeLine{00033\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint16\_t\ *flags\_register,\ \textcolor{comment}{//\ 接收数据的16位寄存器地址}}
\DoxyCodeLine{00034\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ uint8\_t\ *rx\_data);\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ 接收的float数据存储地址}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
